'''
/*
 * @Author: wevsmy 
 * @Date: 2017-10-25 14:35:43 
 * @Last Modified by: wevsmy
 * @Last Modified time: 2017-10-25 14:44:47
 */
'''
from socket import *
from time import ctime
def main():
    udpSocket = socket(AF_INET,SOCK_DGRAM)

    udpSocket.bind(("", 7788))
    num = 1
    while True:
        recvInfo = udpSocket.recvfrom(1024)
        udpSocket.sendto(recvInfo[0],recvInfo[1])
        print('已经将接收到的第%d个数据返回给对方,内容为:%s'%(num,recvInfo[0].decode("gb2312")))
        num += 1

if __name__ == '__main__':
    main()
    